package io.github.pigmesh.ai.deepseek.core.search;


public class SearchRequest {
    private final boolean enable;
    private String query;
    private final FreshnessEnums freshness;
    private final boolean summary;
    private final boolean answer = false;
    private final int count;
    private final int page;

    private static FreshnessEnums $default$freshness() {
        return FreshnessEnums.NO_LIMIT;
    }

    private static boolean $default$summary() {
        return true;
    }

    private static int $default$count() {
        return 10;
    }

    private static int $default$page() {
        return 1;
    }

    SearchRequest(boolean enable, String query, FreshnessEnums freshness, boolean summary, int count, int page) {
        this.enable = enable;
        this.query = query;
        this.freshness = freshness;
        this.summary = summary;
        this.count = count;
        this.page = page;
    }

    public static io.github.pigmesh.ai.deepseek.core.search.SearchRequest.SearchRequestBuilder builder() {
        return new io.github.pigmesh.ai.deepseek.core.search.SearchRequest.SearchRequestBuilder();
    }

    public boolean isEnable() {
        return this.enable;
    }

    public String getQuery() {
        return this.query;
    }

    public FreshnessEnums getFreshness() {
        return this.freshness;
    }

    public boolean isSummary() {
        return this.summary;
    }

    public int getCount() {
        return this.count;
    }

    public int getPage() {
        return this.page;
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof io.github.pigmesh.ai.deepseek.core.search.SearchRequest)) {
            return false;
        } else {
            io.github.pigmesh.ai.deepseek.core.search.SearchRequest other = (io.github.pigmesh.ai.deepseek.core.search.SearchRequest)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (this.isEnable() != other.isEnable()) {
                return false;
            } else if (this.isSummary() != other.isSummary()) {
                return false;
            } else if (this.getCount() != other.getCount()) {
                return false;
            } else if (this.getPage() != other.getPage()) {
                return false;
            } else {
                Object this$query = this.getQuery();
                Object other$query = other.getQuery();
                if (this$query == null) {
                    if (other$query != null) {
                        return false;
                    }
                } else if (!this$query.equals(other$query)) {
                    return false;
                }

                Object this$freshness = this.getFreshness();
                Object other$freshness = other.getFreshness();
                if (this$freshness == null) {
                    if (other$freshness != null) {
                        return false;
                    }
                } else if (!this$freshness.equals(other$freshness)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof io.github.pigmesh.ai.deepseek.core.search.SearchRequest;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        result = result * 59 + (this.isEnable() ? 79 : 97);
        result = result * 59 + (this.isSummary() ? 79 : 97);
        result = result * 59 + this.getCount();
        result = result * 59 + this.getPage();
        Object $query = this.getQuery();
        result = result * 59 + ($query == null ? 43 : $query.hashCode());
        Object $freshness = this.getFreshness();
        result = result * 59 + ($freshness == null ? 43 : $freshness.hashCode());
        return result;
    }

    public String toString() {
        return "SearchRequest(enable=" + this.isEnable() + ", query=" + this.getQuery() + ", freshness=" + this.getFreshness() + ", summary=" + this.isSummary() + ", count=" + this.getCount() + ", page=" + this.getPage() + ")";
    }

    public void setQuery(String query) {
        this.query = query;
    }

    public static class SearchRequestBuilder {
        private boolean enable;
        private String query;
        private boolean freshness$set;
        private FreshnessEnums freshness$value;
        private boolean summary$set;
        private boolean summary$value;
        private boolean count$set;
        private int count$value;
        private boolean page$set;
        private int page$value;

        SearchRequestBuilder() {
        }

        public io.github.pigmesh.ai.deepseek.core.search.SearchRequest.SearchRequestBuilder enable(boolean enable) {
            this.enable = enable;
            return this;
        }

        public io.github.pigmesh.ai.deepseek.core.search.SearchRequest.SearchRequestBuilder query(String query) {
            this.query = query;
            return this;
        }

        public io.github.pigmesh.ai.deepseek.core.search.SearchRequest.SearchRequestBuilder freshness(FreshnessEnums freshness) {
            this.freshness$value = freshness;
            this.freshness$set = true;
            return this;
        }

        public io.github.pigmesh.ai.deepseek.core.search.SearchRequest.SearchRequestBuilder summary(boolean summary) {
            this.summary$value = summary;
            this.summary$set = true;
            return this;
        }

        public io.github.pigmesh.ai.deepseek.core.search.SearchRequest.SearchRequestBuilder count(int count) {
            this.count$value = count;
            this.count$set = true;
            return this;
        }

        public io.github.pigmesh.ai.deepseek.core.search.SearchRequest.SearchRequestBuilder page(int page) {
            this.page$value = page;
            this.page$set = true;
            return this;
        }

        public io.github.pigmesh.ai.deepseek.core.search.SearchRequest build() {
            FreshnessEnums freshness$value = this.freshness$value;
            if (!this.freshness$set) {
                freshness$value = $default$freshness();
            }

            boolean summary$value = this.summary$value;
            if (!this.summary$set) {
                summary$value = $default$summary();
            }

            int count$value = this.count$value;
            if (!this.count$set) {
                count$value = $default$count();
            }

            int page$value = this.page$value;
            if (!this.page$set) {
                page$value = $default$page();
            }

            return new io.github.pigmesh.ai.deepseek.core.search.SearchRequest(this.enable, this.query, freshness$value, summary$value, count$value, page$value);
        }

        public String toString() {
            return "SearchRequest.SearchRequestBuilder(enable=" + this.enable + ", query=" + this.query + ", freshness$value=" + this.freshness$value + ", summary$value=" + this.summary$value + ", count$value=" + this.count$value + ", page$value=" + this.page$value + ")";
        }
    }
}
